<template>
  <el-main>
    <h1>Dashboard</h1>
    <p>测试云存储删除功能，点开控制台查看响应</p>

    <el-button type="danger" @click="singleDeleteHandler()">删除单个文件</el-button>
    <el-button type="danger" @click="batchDeleteHandler()">批量删除文件</el-button>
  </el-main>
</template>

<script>
import { singleDelete, batchDelete } from '@/api/cloudStorage'
export default {
  name: 'Dashboard',
  props: {},
  data() {
    return {}
  },
  created() {},
  mounted() {},
  methods: {
    singleDeleteHandler() {
      singleDelete({ 'key': 'aaa/bbb/00f91325aabc474e8335773a4356fb83.jpg' }).then((response) => {
        console.log(response)
      })
    },
    batchDeleteHandler() {
      const keys = { 'keys': [
        'aaa/bbb/0b1bf11765814a79974a4218d2168248.jpg',
        'aaa/bbb/16ec9c2a633b4683b60229d87a72723b.jpg',
        'aaa/bbb/2405497bd04843ac9718187bfd96bb60.jpg',
        'aaa/bbb/308022ca59d1452aaec23bf7a741e8c5.jpg',
        'aaa/bbb/39862e07be2c4024a43dc7277aa4e448.jpg'
      ] }
      batchDelete(keys).then((response) => {
        console.log(response)
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
